import 'package:get/get.dart';
import 'package:sweetim/service/api_service.dart';

import '../const/const.dart';
import '../model/friends.dart';
import 'member_service.dart';

class FriendsService extends GetxService {
  final ApiService _apiService = Get.find();
  final MemberService _memberService = Get.find();

  Future<List<Friends>?> queryFriends({int start = 0}) async {
    var resp = await _apiService.get0(queryFriendsUrl, _memberService.token);
    if (resp == null) {
      return null;
    }
    List<dynamic> list = resp["list"];
    return list.map((e) => Friends.fromJson(e)).toList();
  }

}